rolesystem.core
Interface RoleRegistration


public interface RoleRegistration

This interface allows to act within the rolesystem, being registered and thus identified. An instance implementing this interface can be obtained through the method reqRegistration of the interface RoleSystem.

See Also:
RoleSystem.reqRegistration(java.lang.String)

Method Summary
 void dismiss()
          Dismisses this registration.
 void doAction(RoleAction action)
          Does an action through this registration.
 RoleEvent listen()
          Listens to an event occurred to this registration.
 RoleEvent listen(long timeout)
          Listens to an event occurred to this registration.
 RoleEvent listenNoWait()
          Listens to an event occurred to this registration.
 int whoAmI()
          Returns the identifier assigned to this registration.
 

Method Detail

listen

RoleEvent listen()
                 throws RoleException
Listens to an event occurred to this registration. This method returns as soon as an event occurs.

Returns:
The occurred event.
Throws:
RoleException

listen

RoleEvent listen(long timeout)
                 throws RoleException
Listens to an event occurred to this registration. This method returns as soon as an event occurs or the specified timeout expires.

Parameters:
timeout - The maximum time to wait, in milliseconds; if it is 0, this method behaves like the one without timeout.
Returns:
The occurred event, or null if no event is available.
Throws:
RoleException

listenNoWait

RoleEvent listenNoWait()
                       throws RoleException
Listens to an event occurred to this registration. This method returns immediately.

Returns:
The occurred event, or null if no event is available.
Throws:
RoleException

doAction

void doAction(RoleAction action)
              throws RoleException
Does an action through this registration.

Parameters:
action - Action to do.
Throws:
RoleException

whoAmI

int whoAmI()
           throws RoleException
Returns the identifier assigned to this registration.

Returns:
The identifier assigned to this registration.
Throws:
RoleException

dismiss

void dismiss()
             throws RoleException
Dismisses this registration.

Throws:
RoleException